package com.tr.rentcar.controller.houtai.discount;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr.rentcar.model.bean.Discount;
import com.tr.rentcar.model.bean.Order;
import com.tr.rentcar.model.dao.DiscountDao;

@WebServlet("/houtaidiscount")
public class DiscountController extends HttpServlet {

	/**
	 * 优惠券信息展示
	 */
	private static final long serialVersionUID = 1L;
	DiscountDao dd=new DiscountDao();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {
			List<Discount> discount=dd.findAll();
			req.setAttribute("discount", discount);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		req.getRequestDispatcher("/WEB-INF/jsp/houtai_discount.jsp").forward(req, resp);
	}

}
